<?php

require '../conn.php';

require 'config.php';

require '../inc/function.php';

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title></title>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" href="../css/admin.css" type="text/css" />

<script type="text/javascript" src="inc/function.js"></script>

<script type="text/javascript" src="../fy_ckeditor/ckeditor.js"></script>

</head>

<body>

<?php

if ($act=='modify'){

 
 
	$n_title=ReStra(trim($_POST['n_title']));

	$n_content=ReStra($_POST['n_content']);

	$n_date=ReStra($_POST['n_date']);

 
	$n_url=ReStra($_POST['n_url']);

 	$n_pic=ReStra($_POST['n_pic']);

	$k_keyword=ReStra($_POST['k_keyword']);

	$k_description=ReStra($_POST['k_description']);


	if (!isDate($n_date)) Msg('错误的日期格式！','Back');

	$sql="update ".$language."_jingxiao set  n_title='$n_title',n_content='$n_content',n_date='$n_date',n_pic='$n_pic',	k_keyword='$k_keyword',	k_description='$k_description', n_url='$n_url' where n_id=$id";
mysql_query($sql) or die(mysql_error($sql));

Msg('','jingxiao.php?'.$urls);

}

$query=mysql_query('select * from '.$language.'_jingxiao where n_id='.$id);

$row=mysql_fetch_array($query);

?>

<div id="container">

  <div class="edit">

      <h1>经销商分享<a href="javascript:location.reload();">刷新</a>޸</h1>

      <form name="form1" method="post" action="?act=modify&<?php echo $urls.'&id='.$id ?>" onsubmit="return CheckNews(this);">

        <table width="100%" border="0" cellpadding="0" cellspacing="0">

          <tr>

            <td class="edit_title">经销商标题：</td>

            <td><input type="text" name="n_title" class="inputtext" value="<?php echo $row['n_title'] ?>" size="80" maxlength="255" /></td>

          </tr>

		  <tr>

            <td class="edit_title">发布时间：</td>

            <td><input type="text" name="n_date" class="inputtext" value="<?php echo $row['n_date'] ?>" size="30" maxlength="50" /></td>

          </tr>
 

          <tr>

            <td class="edit_title">经销商网站：</td>

            <td><input type="text" name="n_url" class="inputtext" value="<?php echo $row['n_url'] ?>" style="width:98%" maxlength="255" / > 没有则不填</td>

          </tr>

 
 
   <tr>

            <td class="edit_title">缩略图：</td>

            <td>
            <input type="text" name="n_pic" id="n_pic" class="inputtext" value="<?php echo $row['n_pic'] ?>" size="50" maxlength="50" readonly="readonly" />
            &nbsp;尺寸：300x150
            <iframe src="../upload_fy.php?file_type=0&file_id=n_pic" frameborder="0" allowtransparency="true" scrolling="no" width="100%" height="25"></iframe>
            </td>

          </tr>

          <tr>

            <td class="edit_title">经销商关键词：</td>

            <td><input type="text" name="k_keyword" class="inputtext" value="<?php echo $row['k_keyword'] ?>" style="width:98%" maxlength="255" /></td>

          </tr>

          <tr>

            <td class="edit_title">经销商简介：</td>

            <td><textarea name="k_description" style="width:98%; height:50px;" maxlength="305" ><?php echo $row['k_description'] ?></textarea></td>

          </tr>



          <tr>

            <td class="edit_title">经销商内容：</td>

            <td><div class="edit_contents"><textarea name="n_content" class="ckeditor"><?php echo $row['n_content'] ?></textarea></div></td>

          </tr>

          <tr>

            <td class="edit_title" height="30">&nbsp;</td>

			<td><input type="submit" name="button" class="button" value=" 保存 " />&nbsp;&nbsp;<input type="button" name="button" class="button" value=" 返回 " onclick="location.href='jingxiao.php?<?php echo $urls ?>';" /></td>

          </tr>

        </table>

    </form>

 

    </div>

</div>

</body>

</html>